package com.pizza.database;

import java.rmi.*;
import java.rmi.registry.*;
import java.rmi.server.*;
import java.sql.*;
import java.util.*;
import com.pizza.abstrait.*;
import com.pizza.database.mapping.*;
import com.pizza.model.*;
/**
 * Class PizzaManagerClient, client RMI
 *
 */
public class PizzaManagerClient {
	
		
	public static IPizzaManager GetPizzaManager() {
		//PizzaManager pizzaManager = new PizzaManager();
		IPizzaManager iPizzaManager = null;
		//System.setSecurityManager(new RMISecurityManager());
		try {
			// Recherche de l'objet distant
			Registry registry = LocateRegistry.getRegistry(1099);
			String url = "pizzamanager";
			iPizzaManager = (IPizzaManager)registry.lookup(url);
		} catch (Exception e) {
			System.err.println("Erreur de connexion au serveur RMI : "+e);
		}
		return iPizzaManager;
	}

}
